<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$info=pdo_get('yzzc_sun_carbrand',array('id'=>$_GPC['id'],'uniacid'=>$_W['uniacid']));

if(checksubmit('submit')){
    if($_GPC['name']==null) {
        message('请填写品牌名称', '', 'error');
    }
    if($_GPC['zimu']==null) {
        message('请填写品牌首字母', '', 'error');
    }
    $data['name']=$_GPC['name'];
    $data['zimu']=$_GPC['zimu'];
    $data['logo']=$_GPC['logo'];
    $data['uniacid']=$_W['uniacid'];
    $res=pdo_update('yzzc_sun_carbrand',$data,array('uniacid'=>$_W['uniacid'],'id'=>$_GPC['id']));
    if($res){
        message('添加成功',$this->createWebUrl('carbrand',array()),'success');
    }else{
        message('添加失败','','error');
    }
}
include $this->template('web/carbrandedit');